/*****************************************************************************/
/**
 *  @file   KVSMLTiledDisplayWall.h
 *  @author Jun Nishimura, Naohisa Sakamoto
 */
/*----------------------------------------------------------------------------
 *
 *  Copyright (c) Visualization Laboratory, Kyoto University.
 *  All rights reserved.
 *  See http://www.viz.media.kyoto-u.ac.jp/kvs/copyright/ for details.
 *
 *  $Id$
 */
/*****************************************************************************/
#ifndef KVSTILEDDISPLAYVIS__KVSML_TILED_DISPLAY_WALL_H_INCLUDE
#define KVSTILEDDISPLAYVIS__KVSML_TILED_DISPLAY_WALL_H_INCLUDE

#include <kvs/FileFormatBase>
#include <string>
#include <vector>
#include <Core/FileFormat/KVSML/KVSMLTag.h>
#include "Master.h"
#include "Renderer.h"

namespace kvstileddisplayvis
{

class KVSMLTiledDisplayWall : public kvs::FileFormatBase
{
    kvsClassName( kvstileddisplayvis::KVSMLTiledDisplayWall );

protected:

    kvs::kvsml::KVSMLTag            m_kvsml_tag;
    size_t                          m_nrenderers;
    tdw::Master                m_master;
    std::vector<tdw::Renderer> m_renderers;
    bool                            m_is_fullscreen;
    bool                            m_is_sync;

public:

    KVSMLTiledDisplayWall( void );

    KVSMLTiledDisplayWall( const std::string& filename );

    virtual ~KVSMLTiledDisplayWall( void );

public:

    const size_t nrenderers( void ) const;

    const bool isFullscreen( void ) const;

    const bool isSync( void ) const;

    const tdw::Master& master( void ) const;

    const std::vector<tdw::Renderer>& rendererList( void ) const;

public:

    void setFilename( const std::string& filename );

public:

    const bool read( const std::string& filename );

    const bool write( const std::string& filename );

public:

    static const bool CheckFileExtension( const std::string& filename );

    static const bool CheckFileFormat( const std::string& filename );

    friend std::ostream& operator << ( std::ostream& os, const KVSMLTiledDisplayWall& rhs );

};

} // end of namespace kvstileddisplayvis

#endif
